package com.otp.pojo.entity;

import com.otp.pojo.dto.CheckInStatsDto;
import lombok.Data;

@Data
public class CheckInStats {
    private Long courseId;
    private Long studentId;
    private Long totalCheckIns; // 签到次数
    private Long totalSessions; // 总课次
    private Double checkInRate; // 签到率

    public CheckInStatsDto convertToDto(String courseTitle, String studentName) {
        CheckInStatsDto dto = new CheckInStatsDto();
        dto.setCourseId(courseId);
        dto.setCourseTitle(courseTitle);
        dto.setStudentId(studentId);
        dto.setStudentName(studentName);
        dto.setTotalCheckIns(totalCheckIns);
        dto.setTotalSessions(totalSessions);
        dto.setCheckInRate(checkInRate);
        return dto;
    }
}
